﻿/*********************************************************************************
**                                                                              **
**  Copyright (C) 2024 LiLong                                                   **
**  This file is part of GnssLogs.                                              **
**                                                                              **
**  GnssLogs is free software: you can redistribute it and/or modify            **
**  it under the terms of the GNU Lesser General Public License as published by **
**  the Free Software Foundation, either version 3 of the License, or           **
**  (at your option) any later version.                                         **
**                                                                              **
**  GnssLogs is distributed in the hope that it will be useful,                 **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of              **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               **
**  GNU Lesser General Public License for more details.                         **
**                                                                              **
**  You should have received a copy of the GNU Lesser General Public License    **
**  along with GnssLogs.  If not, see <https://www.gnu.org/licenses/>.          **
**********************************************************************************/
#pragma once

#include "FormatMacro.h"

#include <cstdint>
#include <format>
#include <optional>
#include <string>
#include <vector>

namespace GnssLogs
{
namespace GSA
{
struct Data
{
    enum class MAMode
    {
        Automatic,
        Manual
    };
    enum class Mode123
    {
        FixNotAvailable = 0x01,
        Mode2D          = 0x02,
        Mode3D          = 0x03
    };
    std::string header;
    MAMode maMode;
    Mode123 mode123;
    std::vector<uint8_t> prns;
    double pdop;
    double hdop;
    double vdop;
    std::optional<uint8_t> systemId;
    uint8_t checkSum;
};
} // namespace GSA
} // namespace GnssLogs

GNSSLOGS_DECLARE_FORMATTER(GnssLogs::GSA::Data)
GNSSLOGS_ENUM_DECLARE_FORMATTER(GnssLogs::GSA, Data::MAMode, Automatic, Manual)
GNSSLOGS_ENUM_DECLARE_FORMATTER(GnssLogs::GSA, Data::Mode123, FixNotAvailable, Mode2D, Mode3D)